﻿using FreeSql.DataAnnotations;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ProjectManageSystemApi.DbEntity
{
    /// <summary>
    /// 采购单据
    /// </summary>
    [JsonObject(MemberSerialization.OptIn), Table(Name = "purchase_order", DisableSyncStructure = true)]
    public class PurchaseOrder
    {
        [JsonProperty, Column(Name = "id", IsPrimary = true, IsIdentity = true)]
        public int Id { get; set; }

        [JsonProperty, Column(Name = "amount")]
        public decimal Amount { get; set; }

        [JsonProperty, Column(Name = "plan")]
        public string Plan { get; set; }

        [JsonProperty, Column(Name = "buyer")]
        public long Buyer { get; set; }

        [JsonProperty, Column(Name = "create_time")]
        public DateTime CreateTime { get; set; }

        [JsonProperty, Column(Name = "create_user")]
        public long CreateUser { get; set; }

        [Navigate(nameof(CreateUser))]
        public UserInfo CreateUserInfo { get; set; }

        [Navigate(nameof(Buyer))]
        public UserInfo BuyerUserInfo { get; set; }
    }
}
